<style>
.product-left
{
	width:200px;	
}
.product-right
{
	width:280px;	
}
.product-mainimage
{
	text-align:center;	
}
.product-subimage
{
	text-align:center;
	margin-top:5px;
}
</style>
<?php
	$menu = new Menu();
	$menu->loadByKeyLang("category",$lang);
	
	$obj = new Post();
	$obj->loadBykeyLang($id,$lang);
	
	
?>
<link rel='stylesheet' type='text/css' href='<?php echo HTTP_SERVER.DIR_VIEW?>css/product.css'>
<div class="ben-section">
    <div class=" ben-section-title"><?php echo $objMenu->getPath(""," - ",$lang)?></div>
    <div class=" ben-section-content">
        <div class="ben-post">
            <div class="ben-left product-left">
                
                <?php if($obj->ImageID != 0){ ?>
                <div class="product-mainimage">
                    <img id="product-preview" src="<?php echo $img->resizePNG($obj->ImagePath,250,250)?>"/>
                </div>
                
                <?php }?>
                <div class="product-subimage">
                    <?php 
                    if(count($subimage))
                    foreach($subimage as $key => $val){ ?>
                    <img id="icon-<?php echo $key?>" class="product-icon" src="<?php echo $img->resizePNG($val['ImagePath'],50,50)?>" />
                    <?php } ?>
                </div>
                <div style="display:none">
                    <?php foreach($subimage as $key => $val){ ?>
                    <img id="preview-<?php echo $key?>" src="<?php echo $img->resizePNG($val['ImagePath'],250,250)?>" />
                    <?php } ?>
                </div>
            </div>
            <div class="ben-right product-right">
                <h2><?php echo $obj->Title?></h2>
                
                <div class="ben-post-body">
                    <p>
                        <b><?php echo $obj->Summary?></b>
                        
                    </p>
                </div>
                <div class="ben-right"><?php echo numberFormat($obj->Price)?> VNĐ</div>
                <div class="clearer">&nbsp;</div>
               
            </div>
            <div class="clearer">&nbsp;</div>
        </div>
        <div class="ben-hline"></div>
        <p>
            <?php echo $obj->Detail?>
        </p>
        
        
        
        <div class="ben-hline"></div>
        
        
        
        <div class="clearer">&nbsp;</div>
    
    </div>
</div>
<script language="javascript">
$(".product-icon").click(function(){
	var arr = this.id.split("-");
	var key = arr[1];
	$("#product-preview").attr("src",$("#preview-"+key).attr("src"));
});
</script>